﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using FluentNHibernate.Testing;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using YasharEl.Infrastructure.Core.PersistenceModel.NHibernate.Prototype.Mappings;
using YasharEl.Infrastructure.Core.Personification;
using YasharEl.Infrastructure.ProcessEngine.EntityModel;
using YasharEl.Infrastructure.ProcessEngine.PersistenceModel.NHibernate.Mappings;

namespace YasharEl.Infrastructure.ProcessEngine.PersistenceModel.NHibernate.Tests
{
    [TestClass]
    public class ProcessParticipantMappingTest: InMemoryDatabaseTest
    {
        public ProcessParticipantMappingTest()
            : base
            (
                new Assembly[] 
                { 
                    typeof(ProcessDefinitionEntityMap).Assembly, 
                    typeof(PropertyDefinitionEntityMap).Assembly 
                }
            )
        {

        }

        [TestMethod]
        public void CanCorrectlyMapProcessParticipant()
        {
            new PersistenceSpecification<ProcessParticipantEntity>(session)
                .CheckProperty(c => c.ParticipantId, (long)1)
                .CheckProperty(c => c.UserName, new Name("dmitry", null, "khaymov"))
                .CheckProperty(c => c.Email, "dmitry.khaymov@gmail.com")
                .VerifyTheMappings();
        }
    }
}
